import request from "@/utils/request";
/** 排班查询参数 */
export interface ScheduleQuery {
  date?: string;
}
/** 排班表单 */
export interface ScheduleForm {
  scheduleDate?: string;
  scheduleDurationType?: string;
  lawFirmId: undefined;
  lawFirmName?: string;
  lawyerId?: undefined;
  lawyerName?: string;
  createdAt?: string;
  updateAt?: string;
  isFull: boolean;
  reservationTimeInfos: [
    {
      id?: number;
      startTime?: string;
      endTime?: string;
      timeFlag?: string;
      canReservation?: boolean;
    },
  ];
  bookingTime?: string;
  id?: string;
}
/** 排班对象 */
export interface ScheduleVO {
  createdAt?: string;
  id: number;
  jobName: string;
  updateAt?: string;
}
class scheduleAPI {
  /** 获取排班列表 */
  static getSchedule(params: string) {
    return request<any, ScheduleVO[]>({
      url: `/api/lawyer/schedule/date?date=${params}`,
      method: "get",
      // data: params,
    });
  }
  /** 新增+修改 排班列表 */
  static updateSchedule(params: ScheduleForm) {
    return request<any, ScheduleVO[]>({
      url: "/api/lawyer/schedule",
      method: "post",
      data: params,
    });
  }
  /** 删除排班列表 */
  static deleteSchedule(id: string) {
    return request({
      url: `/api/lawyer/schedule/${id}`,
      method: "delete",
      // data: params,
    });
  }
}

export default scheduleAPI;
